# -*- coding: utf8 -*-
# -*- version: 3.12.2 -*-
# -*- date: 2024-6-14 -*-
# 文件处理行

import os.path


def check_dir(path_name: str, is_file: bool = False):
    """
    检查所在目录是否存在，不存在则创建
    """
    if is_file:
        path_name = os.path.dirname(path_name)
    if not os.path.exists(path_name):
        os.makedirs(path_name)